#ifndef CANVAS_H_INCLUDED
#define CANVAS_H_INCLUDED

#include "container.h"

class Canvas : public Container
{
	public:
		Canvas();
		~Canvas();

		void draw();
		void setDefaultZAxis();
		
// 		void moveMouse(unsigned int x, unsigned int y);
		void moveMouse();
		void moveMouseX(unsigned int x);
		void moveMouseY(unsigned int y);

		bool mouseFocus;

		void buttonPress(const unsigned int& button);
		void buttonRelease(const unsigned int& button);
		
		void swapChild(const std::string& child);
		void raisePanel(Widget* w);
		
	private:
		unsigned int m_x;
		unsigned int m_y;
		unsigned int m_oldx;
		unsigned int m_oldy;
		
		bool hasPickedwidget;
		Widget* pickedwidget;

		Widget* focussedwidget;

		std::vector<std::string> sortedindices;

		void	drawChildren();
		bool	mouseOverChild( Widget** fWidget, int x, int y );
};

#endif
